package com.zlll.winner.controller;

import com.alibaba.fastjson.JSONObject;
import com.zlll.winner.business.service.todayHot.ITodayHotService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("api/todayHot")
@RestController
public class TodayHotController {

    @Reference(version = "${dubbo.consumer.version}")
    private ITodayHotService todayHotService;

    @RequestMapping("getTodayHotList")
    public Object getTodayHotList(@RequestBody JSONObject data) {
        Integer pageSize = data.getInteger("pageSize") == null ? 5 : data.getInteger("pageSize");
        Integer pageNo = data.getInteger("pageNo") == null ? 1 : data.getInteger("pageNo");

        return todayHotService.getTodayHotList(pageSize, pageNo);
    }
}
